home *** CD-ROM | disk | FTP | other *** search
Text File | 1992-09-13 | 5.5 KB | 211 lines | [TEXT/KAHL] |
- /****************************************************************************************
- *
- * GlobalEqu.p - Global Equates for Generic Appshell. Note- this file should
- * generally be #included in every component file in the project,
- * which means that editing a value here will force a complete
- * recompilation of the project. Therefore, define local constants
- * seperately.
- *
- ****************************************************************************************/
-
-
- #define standardResID 128 /* base number of resources */
- #define sleepTime 2 /* WNE sleep parameter */
-
- #define NIL 0L
-
- #define appleMenu 0
- #define fileMenu 1
- #define editMenu 2
- #define asmMenu 3
- #define pdpMenu 4
-
- #define NumMenus 5
- #define NumWindows 2
-
- #define ItemAbout 1
-
- #define ItemNew 1
- #define ItemOpen 2
- #define ItemClose 3
- /*--------------------------*/
- #define ItemSave 5
- #define ItemSaveAs 6
- /*--------------------------*/
- #define ItemPageSetup 8
- #define ItemPrint 9
- /*--------------------------*/
- #define ItemQuit 11
-
- #define ItemUndo 1
- /*--------------------------*/
- #define ItemCut 3
- #define ItemCopy 4
- #define ItemPaste 5
- #define ItemClear 6
- /*--------------------------*/
- #define ItemShowClip 8
-
- #define ItemGo 1
- #define ItemHalt 2
- #define ItemReset 3
- #define ItemSingleStep 4
- #define ItemScrollToPC 5
- /*--------------------------*/
- #define ItemPreferences 7
- #define ItemGetInfo 8
- /*--------------------------*/
- #define ItemStack 10
- #define ItemShowRuler 11
-
- #define ItemAssemble 1
- /*--------------------------*/
- #define ItemToDisk 3
- #define ItemToMemory 4
- #define ItemToBasingstoke 5
- /*--------------------------*/
- #define ItemLoadObject 7
-
- #define toDisk 0
- #define toMemory 1
-
- #define GeneralAlertNoCancel 129
- #define GeneralAlertCancel 130
- #define CriticalMemoryAlert 131
-
- typedef unsigned int PDPWord;
- typedef PDPWord *PDPWordPtr;
-
- /* note that only the LOWER 12 BITS are used in each instance of a PDPWord. The upper
- bits should be assumed not to exist (as they might not in future) */
-
- typedef struct
- {
- int version; /* version number of this file */
- int codeOrigin; /* origin of code for loading */
- long cwLength; /* number of words to load */
- long reserved; /* reserved */
- PDPWord firstWord; /* first code word in file */
- }
- ObjectHeader, *ObjectPtr;
-
- typedef struct
- {
- PDPWord IR; /* instruction register */
- PDPWord PC; /* program counter */
- PDPWord EAR; /* Effective Address Register */
- PDPWord ACC; /* Accumulator */
- Byte CCR; /* Condition Code register (L is bit 0) */
- Byte Padding; /* Pad Byte -reserved for future use */
- Rect markerLoc; /* used by graphics to update PC marker */
- }
- PDPRegisters, *PDPRegPtr, **PDPRegHdl;
-
- #define LBit 1
- #define Link 1
- #define HaltBit 128
-
- typedef PDPWord PDPMemory[4096], *PDPMemPtr, **PDPMemHdl;
-
- #define EditKind 11
- #define ObjectKind 12
- #define SimulatorKind 13
-
- typedef struct
- {
- int NumberFormat; /* format for display of values */
- int CPUSpeed; /* ticks between instruction fetches */
- int DefaultStart; /* default start vector for this process */
- long reserved;
- long cycleTime; /* tick count of last cycle */
- Byte EARPointerVis; /* TRUE if EAR pointer is displayed */
- Byte MnemonicIR; /* TRUE if mnemonics displayed in IR */
- Byte AutoScroll; /* TRUE if auto scrolling enabled */
- }
- PrefsRec, *PrefsRecPtr, **PrefsRecHdl;
-
- typedef struct
- {
- PDPMemHdl theMemory; /* Handle to memory for this process */
- PDPRegHdl theCPU; /* Handle to CPU for this process */
- WindowPtr processOwner; /* window this process is bound to */
- PrefsRecHdl procPrefs; /* handle to preferences */
- long reserved2; /* future expansion */
- ControlHandle memScroll; /* memory scroll bar */
- int memLocHeight; /* height of memory cell display */
- int processID; /* ID number of this process */
- }
- ProcessRec, *ProcessRecPtr, **ProcessRecHdl;
-
- #define FastCPU 0
- #define MediumCPU 20
- #define SlowCPU 60
- #define SingleStep -1
- #define Decimal 0
- #define Octal 1
- #define Hexadecimal 2
- #define Binary 3
-
- /* loader and runner error codes */
-
- #define TargetNotSimulator -177
- #define CodeFileIsNIL -178
- #define CodeFileIsEmpty -179
- #define CodeFileTooLong -180
- #define LoadAddressOutOfRange -181
- #define TargetHasNoMemory -182
- #define TargetHasNoProcessor -183
- #define StartVectorOutOfRange -184
- #define IllegalInstruction -185
- #define ProcessHalted -186
- #define ProcessHasDied -187
- #define CodeFileBadVersion -188
- #define CPUAddressingError -189
- #define MemWriteUpdateRequest -190
-
- /* error codes for the assembler are numbered from -191 onwards */
-
- /* opcode equates for basic opcode types */
-
- #define pdpAND 0
- #define pdpTAD 1
- #define pdpISZ 2
- #define pdpDCA 3
- #define pdpJMS 4
- #define pdpJMP 5
- #define pdpIO 6
- #define pdpACC 7
-
- /* bitfield equates for group 1 ACC operations */
-
- #define GroupBit 256
- #define pdpCLA 128
- #define pdpCLL 64
- #define pdpCMA 32
- #define pdpCML 16
- #define pdpRBit 8
- #define pdpLBit 4
- #define pdpCBit 2
- #define pdpIAC 1
-
- /* bitfield equates for group 2 ACC operations */
-
- #define pdpSMA 64
- #define pdpSZA 32
- #define pdpSNL 16
- #define pdpOSR 4
- #define pdpHLT 2
- #define pdpUnused 1
-
- #define opcodeMask 0x0E00
- #define addressModeMask 0x0180
- #define indirectBit 2
- #define pageBit 1
- #define operandMask 0x007F
- #define topFiveBits 0x0F80
- #define bottom7Bits 0x007F
- #define rotateLeft 0
- #define rotateRight 1
-
- #define memAreaWidth 150
- #define statusBarHeight 26